/*
 * Copyright (c) 2014 laidian. All Rights Reserved.
 * 
 * @author yaoyuming
 * 
 * @date 2019-12-04 19:55
 */
package com.yao.cloud.consumer.apiclient;

import feign.hystrix.FallbackFactory;

/**
 * @author yaoyuming
 * @date 2019/12/04 19:55
 */
public class FeignFallbackFactory implements FallbackFactory<EurekaApi> {

    private final FeignFallback feignFallback;

    public FeignFallbackFactory(FeignFallback feignFallback) {
        this.feignFallback = feignFallback;
    }

    @Override
    public EurekaApi create(Throwable throwable) {
        throwable.printStackTrace();
        return feignFallback;
    }
}